package knowse.app.presentation;

import java.io.IOException;
import java.util.ArrayList;

import knowse.app.FetchData;
import knowse.app.ProjectDataObject;
import knowse.app.R;
import knowse.app.TestDataObject;
import knowse.app.controller.LogCommitController;
import knowse.app.daos.CommitDataObject;
import knowse.app.daos.LogDataObject;

import org.json.JSONObject;

import android.app.ListActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;

public class LogCommitActivity extends ListActivity{

	ArrayList<String> commitStrArr;
	
	@Override
	public void onCreate(Bundle savedInstanceState){
		super.onCreate(savedInstanceState);
		setContentView(R.layout.logcommitactivity);
		
		
		//oncreate
		/* 1.create a instance of Controller 
		 * 2.get CommitArray
		 * 2.Foreach Commit ->tostring
		 * 3.put in Arrayadpter
		 */
		
		LogCommitController controller= new LogCommitController();
		
		this.commitStrArr = controller.getCommitsString();
			
		ArrayAdapter<String> adapter = 
				new ArrayAdapter<String>(this,
										 android.R.layout.simple_list_item_1,
										 commitStrArr);
		setListAdapter(adapter);
		
	}
	

	
	protected void onListItemClick(ListView l, View v, int position, long id){

	}
	

}
